
const app = {
  state: {
    imgKey: '',
    imgShow: false
  },
  mutations: {
    SET_PIC_URL: (state, imgKey) => {
      state.imgKey = imgKey
    },
    SET_PIC_SHOW: (state, imgShow) => {
      state.imgShow = imgShow
    }
  },
  actions: {
    PicPreview({ commit }, imgKey) {
      console.log(imgKey)
      commit('SET_PIC_URL', imgKey)
      commit('SET_PIC_SHOW', true)
    },
    ClosePicPreview({ commit }) {
      commit('SET_PIC_SHOW', false)
    }
  }
}

export default app
